﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace AppHelper
{
    public class UserInfo
    {
        public static int MusteriID
        {
            get { return Int32.Parse(GetKullanici().Split(',')[0]); }
        }
        public static string MusteriEmail
        {
            get { return GetKullanici().Split(',')[1]; }
        }
        public static string MusteriAdi
        {
            get { return GetKullanici().Split(',')[2]; }
        }
        public static string MusteriSoyadi
        {
            get { return GetKullanici().Split(',')[3]; }
        }
        private static string GetKullanici()
        {
            string deger = string.Empty;
            if (HttpContext.Current.Session["User"] != null)
            {
                deger = HttpContext.Current.Session["User"].ToString();
            }
            return deger;
        }

        public static bool IsAuthenticated()
        {
            bool deger = false;
            if (HttpContext.Current.Session["User"] != null)
            {
                deger = true;
            }
            return deger;
        }
    }
}
